#include	<iostream>
#include	<fstream>
#include	<sstream>
using	namespace	std;

int	main(void){
	ifstream	fi("pubmed.txt");
	ofstream	fo("abstract.txt");
	string	line;
	bool	on=false;
	string	ab;
	while(getline(fi,line))	if(line.size()){
		if(line[0]=='A'&&line.size()>1&&line[1]=='B'){
			on=true;
			if(ab.size()){
				istringstream	si(ab);
				string	s;
				si>>s>>s;
				while(!si.eof()){
					s.clear();
					si>>s;
					if(s.size())	fo<<s<<' ';
				}
				fo<<'\n';
			}
			ab=line;
		}
		else	if(line[0]==' '){
			if(on)	ab+=line;
		}
		else	on=false;
	}
	fo.close();
	fi.close();
	return	0;	
}